import Vue from 'vue'
import VueRouter from 'vue-router'
import refreshRouter from '../router/refresh'

Vue.use(VueRouter)

const routes = [
  // 首页
  {
    path: '/',
    name: 'home',
    component: () => import('../views/Home.vue')
  },
  // 成功案例
  {
    path: '/case',
    name: 'case',
    component: () => import('../views/case.vue')
  },
  // 订单
  {
    path: '/package',
    name: 'package',
    component: () => import('../views/package.vue')
  },
  // 个人
  {
    path: '/personal',
    name: 'personal',
    component: () => import('../views/personal.vue')
  },
  // 登录
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login.vue')
  },
  // 首页-套餐详情
  {
    path: '/homeDetails',
    name: 'homeDetails',
    component: () => import('@/views/homeDetails.vue')
  },
  // 下单确认信息
  {
    path: '/confirmOrder',
    name: 'confirmOrder',
    component: () => import('@/views/confirmOrder.vue')
  },
  // 订单-套餐详情
  {
    path: '/packageDetails',
    name: 'packageDetails',
    component: () => import('@/views/packageDetails.vue')
  },
  // 订单-疗程记录
  {
    path: '/courseRecord',
    name: 'courseRecord',
    component: () => import('@/views/courseRecord.vue')
  },
  // 预约信息
  {
    path: '/reservation',
    name: 'reservation',
    component: () => import('@/views/reservation.vue')
  },
  // 上传验光报告
  {
    path: '/uploadReport',
    name: 'uploadReport',
    component: () => import('@/views/uploadReport.vue')
  },
  // 用户协议
  {
    path: '/userAgreement',
    name: 'userAgreement',
    component: () => import('@/views/userAgreement.vue')
  },
  // 调理须知
  {
    path: '/userNotice',
    name: 'userNotice',
    component: () => import('@/views/userNotice.vue')
  },
  // 测试
  {
    path: '/test',
    name: 'test',
    component: () => import('@/views/test.vue')
  }
]

const router = new VueRouter({
  // routes
  routes: [...refreshRouter, ...routes]
})

export default router
